package com.cy.pj.goods.dao;

import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.Connection;
import java.util.List;

@Repository
public class GoodsDaoImpl implements GoodsDao {

    @Autowired
    private SqlSession sqlSession;

    @Override
    public List<Goods> findGoods() {
//        List<Goods> list = sqlSession.selectList("com.cy.pj.goods.dao.GoodsDao.findGoods");
        List<Goods> list = sqlSession.getMapper(GoodsDao.class).findGoods();
        Connection conn = sqlSession.getConnection();
//        conn.createStatement();
//        conn.prepareStatement();
        return list;

    }
}
